package de.andreavicentini.teatralia.pages.events;

import java.util.Locale;

import org.magiclabs.htmlx.Area;
import org.magiclabs.htmlx.PropertiesTextStructure;
import org.magiclabs.htmlx.TextStructure;

import de.andreavicentini.teatralia.generate.Events;
import de.andreavicentini.teatralia.generate.Layout;
import de.andreavicentini.teatralia.pages.TeatraliaPage;

public class EventsPage extends TeatraliaPage {
	
	public enum Keys implements TextStructure.TextKey {
		title, intro, subtitle;
	}
	
	private final Iterable<Event> events;
	private final String htmlName;
	
	public EventsPage(Area area, String htmlName, String bundle, Iterable<Event> events) {
		super(new Events(), Keys.title, Keys.subtitle, area.getLayout(), area, new PropertiesTextStructure(EventsPage.class, bundle));
		this.htmlName = htmlName;
		this.events = events;
	}
	
	@Override
	public String getName(Locale locale) {
		return this.htmlName + "(" + locale + ")";
	}
	
	public Iterable<Event> iterateEvents() {
		return this.events;
	}


	@Override
	public boolean hasFooter() { return false; }
}
